<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: treeview   TreeView.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>TreeView Widget&nbsp; <span class="subtitle">2.7.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_treeview.html" title="treeview">treeview</a>
                
                 &gt; TreeView.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
<div class="highlight" ><pre><span class="o">(</span><span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
    <span class="k">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">,</span>
        <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">,</span>
        <span class="nx">Lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">,</span>
        <span class="nx">Widget</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">;</span>
        
    

<span class="c">/**</span>
<span class="c"> * The treeview widget is a generic tree building tool.</span>
<span class="c"> * @module treeview</span>
<span class="c"> * @title TreeView Widget</span>
<span class="c"> * @requires yahoo, event</span>
<span class="c"> * @optional animation, json</span>
<span class="c"> * @namespace YAHOO.widget</span>
<span class="c"> */</span>

<span class="c">/**</span>
<span class="c"> * Contains the tree view state data and the root node.</span>
<span class="c"> *</span>
<span class="c"> * @class TreeView</span>
<span class="c"> * @uses YAHOO.util.EventProvider</span>
<span class="c"> * @constructor</span>
<span class="c"> * @param {string|HTMLElement} id The id of the element, or the element itself that the tree will be inserted into.  Existing markup in this element, if valid, will be used to build the tree</span>
<span class="c"> * @param {Array|object|string}  oConfig (optional)  An array containing the definition of the tree.  (see buildTreeFromObject)</span>
<span class="c"> * </span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">TreeView</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">if</span> <span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span> <span class="k">this</span><span class="o">.</span><span class="nx">init</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span> <span class="o">}</span>
    <span class="k">if</span> <span class="o">(</span><span class="nx">oConfig</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(!</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">))</span> <span class="o">{</span>
            <span class="nx">oConfig</span> <span class="o">=</span> <span class="o">[</span><span class="nx">oConfig</span><span class="o">];</span>
        <span class="o">}</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">buildTreeFromObject</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">);</span>
    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">trim</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_el</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">))</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">buildTreeFromMarkup</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
    <span class="o">}</span>
<span class="o">};</span>

<span class="k">var</span> <span class="nx">TV</span> <span class="o">=</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">TreeView</span><span class="o">;</span>

<span class="nx">TV</span><span class="o">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="o">{</span>

    <span class="c">/**</span>
<span class="c">     * The id of tree container element</span>
<span class="c">     * @property id</span>
<span class="c">     * @type String</span>
<span class="c">     */</span>
    <span class="nx">id</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The host element for this tree</span>
<span class="c">     * @property _el</span>
<span class="c">     * @private</span>
<span class="c">     * @type HTMLelement</span>
<span class="c">     */</span>
    <span class="nx">_el</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

     <span class="c">/**</span>
<span class="c">     * Flat collection of all nodes in this tree.  This is a sparse</span>
<span class="c">     * array, so the length property can&#39;t be relied upon for a</span>
<span class="c">     * node count for the tree.</span>
<span class="c">     * @property _nodes</span>
<span class="c">     * @type Node[]</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_nodes</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * We lock the tree control while waiting for the dynamic loader to return</span>
<span class="c">     * @property locked</span>
<span class="c">     * @type boolean</span>
<span class="c">     */</span>
    <span class="nx">locked</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The animation to use for expanding children, if any</span>
<span class="c">     * @property _expandAnim</span>
<span class="c">     * @type string</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_expandAnim</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The animation to use for collapsing children, if any</span>
<span class="c">     * @property _collapseAnim</span>
<span class="c">     * @type string</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_collapseAnim</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The current number of animations that are executing</span>
<span class="c">     * @property _animCount</span>
<span class="c">     * @type int</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_animCount</span><span class="o">:</span> <span class="m">0</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * The maximum number of animations to run at one time.</span>
<span class="c">     * @property maxAnim</span>
<span class="c">     * @type int</span>
<span class="c">     */</span>
    <span class="nx">maxAnim</span><span class="o">:</span> <span class="m">2</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Whether there is any subscriber to dblClickEvent</span>
<span class="c">     * @property _hasDblClickSubscriber</span>
<span class="c">     * @type boolean</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_hasDblClickSubscriber</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
    
    <span class="c">/**</span>
<span class="c">     * Stores the timer used to check for double clicks</span>
<span class="c">     * @property _dblClickTimer</span>
<span class="c">     * @type window.timer object</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_dblClickTimer</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

  <span class="c">/**</span>
<span class="c">     * A reference to the Node currently having the focus or null if none.</span>
<span class="c">     * @property currentFocus</span>
<span class="c">     * @type YAHOO.widget.Node</span>
<span class="c">     */</span>
    <span class="nx">currentFocus</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
    
    <span class="c">/**</span>
<span class="c">    * If true, only one Node can be highlighted at a time</span>
<span class="c">    * @property singleNodeHighlight</span>
<span class="c">    * @type boolean</span>
<span class="c">    * @default false</span>
<span class="c">    */</span>
    
    <span class="nx">singleNodeHighlight</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
    
    <span class="c">/**</span>
<span class="c">    * A reference to the Node that is currently highlighted.</span>
<span class="c">    * It is only meaningful if singleNodeHighlight is enabled</span>
<span class="c">    * @property _currentlyHighlighted</span>
<span class="c">    * @type YAHOO.widget.Node</span>
<span class="c">    * @default null</span>
<span class="c">    * @private</span>
<span class="c">    */</span>
    
    <span class="nx">_currentlyHighlighted</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

    <span class="c">/**</span>
<span class="c">     * Sets up the animation for expanding children</span>
<span class="c">     * @method setExpandAnim</span>
<span class="c">     * @param {string} type the type of animation (acceptable values defined </span>
<span class="c">     * in YAHOO.widget.TVAnim)</span>
<span class="c">     */</span>
    <span class="nx">setExpandAnim</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_expandAnim</span> <span class="o">=</span> <span class="o">(</span><span class="nx">Widget</span><span class="o">.</span><span class="nx">TVAnim</span><span class="o">.</span><span class="nx">isValid</span><span class="o">(</span><span class="nx">type</span><span class="o">))</span> <span class="o">?</span> <span class="nx">type</span> <span class="o">:</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Sets up the animation for collapsing children</span>
<span class="c">     * @method setCollapseAnim</span>
<span class="c">     * @param {string} the type of animation (acceptable values defined in </span>
<span class="c">     * YAHOO.widget.TVAnim)</span>
<span class="c">     */</span>
    <span class="nx">setCollapseAnim</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_collapseAnim</span> <span class="o">=</span> <span class="o">(</span><span class="nx">Widget</span><span class="o">.</span><span class="nx">TVAnim</span><span class="o">.</span><span class="nx">isValid</span><span class="o">(</span><span class="nx">type</span><span class="o">))</span> <span class="o">?</span> <span class="nx">type</span> <span class="o">:</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Perform the expand animation if configured, or just show the</span>
<span class="c">     * element if not configured or too many animations are in progress</span>
<span class="c">     * @method animateExpand</span>
<span class="c">     * @param el {HTMLElement} the element to animate</span>
<span class="c">     * @param node {YAHOO.util.Node} the node that was expanded</span>
<span class="c">     * @return {boolean} true if animation could be invoked, false otherwise</span>
<span class="c">     */</span>
    <span class="nx">animateExpand</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;animating expand&quot;</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_expandAnim</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_animCount</span> <span class="o">&lt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">maxAnim</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// this.locked = true;</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">tree</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">TVAnim</span><span class="o">.</span><span class="nx">getAnim</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_expandAnim</span><span class="o">,</span> <span class="nx">el</span><span class="o">,</span> 
                            <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="nx">tree</span><span class="o">.</span><span class="nx">expandComplete</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span> <span class="o">});</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">a</span><span class="o">)</span> <span class="o">{</span> 
                <span class="o">++</span><span class="k">this</span><span class="o">.</span><span class="nx">_animCount</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;animStart&quot;</span><span class="o">,</span> <span class="o">{</span>
                        <span class="s2">&quot;node&quot;</span><span class="o">:</span> <span class="nx">node</span><span class="o">,</span> 
                        <span class="s2">&quot;type&quot;</span><span class="o">:</span> <span class="s2">&quot;expand&quot;</span>
                    <span class="o">});</span>
                <span class="nx">a</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
            <span class="o">}</span>

            <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Perform the collapse animation if configured, or just show the</span>
<span class="c">     * element if not configured or too many animations are in progress</span>
<span class="c">     * @method animateCollapse</span>
<span class="c">     * @param el {HTMLElement} the element to animate</span>
<span class="c">     * @param node {YAHOO.util.Node} the node that was expanded</span>
<span class="c">     * @return {boolean} true if animation could be invoked, false otherwise</span>
<span class="c">     */</span>
    <span class="nx">animateCollapse</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;animating collapse&quot;</span><span class="o">);</span>

        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_collapseAnim</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_animCount</span> <span class="o">&lt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">maxAnim</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// this.locked = true;</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">tree</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">TVAnim</span><span class="o">.</span><span class="nx">getAnim</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_collapseAnim</span><span class="o">,</span> <span class="nx">el</span><span class="o">,</span> 
                            <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="nx">tree</span><span class="o">.</span><span class="nx">collapseComplete</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span> <span class="o">});</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">a</span><span class="o">)</span> <span class="o">{</span> 
                <span class="o">++</span><span class="k">this</span><span class="o">.</span><span class="nx">_animCount</span><span class="o">;</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;animStart&quot;</span><span class="o">,</span> <span class="o">{</span>
                        <span class="s2">&quot;node&quot;</span><span class="o">:</span> <span class="nx">node</span><span class="o">,</span> 
                        <span class="s2">&quot;type&quot;</span><span class="o">:</span> <span class="s2">&quot;collapse&quot;</span>
                    <span class="o">});</span>
                <span class="nx">a</span><span class="o">.</span><span class="nx">animate</span><span class="o">();</span>
            <span class="o">}</span>

            <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Function executed when the expand animation completes</span>
<span class="c">     * @method expandComplete</span>
<span class="c">     */</span>
    <span class="nx">expandComplete</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;expand complete: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
        <span class="o">--</span><span class="k">this</span><span class="o">.</span><span class="nx">_animCount</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;animComplete&quot;</span><span class="o">,</span> <span class="o">{</span>
                <span class="s2">&quot;node&quot;</span><span class="o">:</span> <span class="nx">node</span><span class="o">,</span> 
                <span class="s2">&quot;type&quot;</span><span class="o">:</span> <span class="s2">&quot;expand&quot;</span>
            <span class="o">});</span>
        <span class="c">// this.locked = false;</span>
<span class="c"></span>    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Function executed when the collapse animation completes</span>
<span class="c">     * @method collapseComplete</span>
<span class="c">     */</span>
    <span class="nx">collapseComplete</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;collapse complete: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
        <span class="o">--</span><span class="k">this</span><span class="o">.</span><span class="nx">_animCount</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s2">&quot;animComplete&quot;</span><span class="o">,</span> <span class="o">{</span>
                <span class="s2">&quot;node&quot;</span><span class="o">:</span> <span class="nx">node</span><span class="o">,</span> 
                <span class="s2">&quot;type&quot;</span><span class="o">:</span> <span class="s2">&quot;collapse&quot;</span>
            <span class="o">});</span>
        <span class="c">// this.locked = false;</span>
<span class="c"></span>    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Initializes the tree</span>
<span class="c">     * @method init</span>
<span class="c">     * @parm {string|HTMLElement} id the id of the element that will hold the tree</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">init</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_el</span><span class="o">,</span><span class="s2">&quot;yui-tv-auto-id-&quot;</span><span class="o">);</span>

    <span class="c">/**</span>
<span class="c">         * When animation is enabled, this event fires when the animation</span>
<span class="c">         * starts</span>
<span class="c">         * @event animStart</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing</span>
<span class="c">         * @parm {String} type the type of animation (&quot;expand&quot; or &quot;collapse&quot;)</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;animStart&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * When animation is enabled, this event fires when the animation</span>
<span class="c">         * completes</span>
<span class="c">         * @event animComplete</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node that is expanding/collapsing</span>
<span class="c">         * @parm {String} type the type of animation (&quot;expand&quot; or &quot;collapse&quot;)</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;animComplete&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * Fires when a node is going to be collapsed.  Return false to stop</span>
<span class="c">         * the collapse.</span>
<span class="c">         * @event collapse</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node that is collapsing</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;collapse&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * Fires after a node is successfully collapsed.  This event will not fire</span>
<span class="c">         * if the &quot;collapse&quot; event was cancelled.</span>
<span class="c">         * @event collapseComplete</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node that was collapsed</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;collapseComplete&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * Fires when a node is going to be expanded.  Return false to stop</span>
<span class="c">         * the collapse.</span>
<span class="c">         * @event expand</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node that is expanding</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;expand&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

        <span class="c">/**</span>
<span class="c">         * Fires after a node is successfully expanded.  This event will not fire</span>
<span class="c">         * if the &quot;expand&quot; event was cancelled.</span>
<span class="c">         * @event expandComplete</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node that was expanded</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;expandComplete&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

    <span class="c">/**</span>
<span class="c">         * Fires when the Enter key is pressed on a node that has the focus</span>
<span class="c">         * @event enterKeyPressed</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node that has the focus</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;enterKeyPressed&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
        
    <span class="c">/**</span>
<span class="c">         * Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a Click.</span>
<span class="c">    * The listener may return false to cancel toggling and focusing on the node.</span>
<span class="c">         * @event clickEvent</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param oArgs.event  {HTMLEvent} The event object</span>
<span class="c">         * @param oArgs.node {YAHOO.widget.Node} node the node that was clicked</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;clickEvent&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
        
    <span class="c">/**</span>
<span class="c">         * Fires when the focus receives the focus, when it changes from a Node </span>
<span class="c">    * to another Node or when it is completely lost (blurred)</span>
<span class="c">         * @event focusChanged</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param oArgs.oldNode  {YAHOO.widget.Node} Node that had the focus or null if none</span>
<span class="c">         * @param oArgs.newNode {YAHOO.widget.Node} Node that receives the focus or null if none</span>
<span class="c">         */</span>
        
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s1">&#39;focusChanged&#39;</span><span class="o">,</span><span class="k">this</span><span class="o">);</span>

    <span class="c">/**</span>
<span class="c">         * Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a double Click</span>
<span class="c">         * @event dblClickEvent</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param oArgs.event  {HTMLEvent} The event object</span>
<span class="c">         * @param oArgs.node {YAHOO.widget.Node} node the node that was clicked</span>
<span class="c">         */</span>
        <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;dblClickEvent&quot;</span><span class="o">,</span> <span class="o">{</span>
            <span class="nx">scope</span><span class="o">:</span><span class="k">this</span><span class="o">,</span>
            <span class="nx">onSubscribeCallback</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="nx">self</span><span class="o">.</span><span class="nx">_hasDblClickSubscriber</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">});</span>
        
    <span class="c">/**</span>
<span class="c">         * Custom event that is fired when the text node label is clicked. </span>
<span class="c">         *  The node clicked is  provided as an argument</span>
<span class="c">         *</span>
<span class="c">         * @event labelClick</span>
<span class="c">         * @type CustomEvent</span>
<span class="c">         * @param {YAHOO.widget.Node} node the node clicked</span>
<span class="c">    * @deprecated use clickEvent or dblClickEvent</span>
<span class="c">         */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;labelClick&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
        
    <span class="c">/**</span>
<span class="c">     * Custom event fired when the highlight of a node changes.</span>
<span class="c">     * The node that triggered the change is provided as an argument:</span>
<span class="c">     * The status of the highlight can be checked in </span>
<span class="c">     * &lt;a href=&quot;YAHOO.widget.Node.html#property_highlightState&quot;&gt;nodeRef.highlightState&lt;/a&gt;.</span>
<span class="c">     * Depending on &lt;a href=&quot;YAHOO.widget.Node.html#property_propagateHighlight&quot;&gt;nodeRef.propagateHighlight&lt;/a&gt;, other nodes might have changed</span>
<span class="c">     * @event highlightEvent</span>
<span class="c">     * @type CustomEvent</span>
<span class="c">        * @param node{YAHOO.widget.Node} the node that started the change in highlighting state</span>
<span class="c">    */</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">createEvent</span><span class="o">(</span><span class="s2">&quot;highlightEvent&quot;</span><span class="o">,</span><span class="k">this</span><span class="o">);</span>
     


        <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span> <span class="o">=</span> <span class="o">[];</span>

        <span class="c">// store a global reference</span>
<span class="c"></span>        <span class="nx">TV</span><span class="o">.</span><span class="nx">trees</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">]</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>

        <span class="c">// Set up the root node</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">root</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">RootNode</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>

        <span class="k">var</span> <span class="nx">LW</span> <span class="o">=</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">LogWriter</span><span class="o">;</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span> <span class="o">=</span> <span class="o">(</span><span class="nx">LW</span><span class="o">)</span> <span class="o">?</span> <span class="k">new</span> <span class="nx">LW</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">toString</span><span class="o">())</span> <span class="o">:</span> <span class="nx">YAHOO</span><span class="o">;</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;tree init: &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
        
        <span class="c">// YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);</span>
<span class="c"></span>        <span class="c">// YAHOO.util.Event.on(this.id, &quot;click&quot;, this.handleClick, this, true);</span>
<span class="c"></span>    <span class="o">},</span>

    <span class="c">//handleAvailable: function() {</span>
<span class="c"></span>        <span class="c">//var Event = YAHOO.util.Event;</span>
<span class="c"></span>        <span class="c">//Event.on(this.id, </span>
<span class="c"></span>    <span class="c">//},</span>
<span class="c"></span> <span class="c">/**</span>
<span class="c">     * Builds the TreeView from an object.  </span>
<span class="c">     * This is the method called by the constructor to build the tree when it has a second argument.</span>
<span class="c">     *  A tree can be described by an array of objects, each object corresponding to a node.</span>
<span class="c">     *  Node descriptions may contain values for any property of a node plus the following extra properties: &lt;ul&gt;</span>
<span class="c">     * &lt;li&gt;type:  can be one of the following:&lt;ul&gt;</span>
<span class="c">     *  &lt;li&gt; A shortname for a node type (&lt;code&gt;&#39;text&#39;,&#39;menu&#39;,&#39;html&#39;&lt;/code&gt;) &lt;/li&gt;</span>
<span class="c">     * &lt;li&gt;The name of a Node class under YAHOO.widget (&lt;code&gt;&#39;TextNode&#39;, &#39;MenuNode&#39;, &#39;DateNode&#39;&lt;/code&gt;, etc) &lt;/li&gt;</span>
<span class="c">     * &lt;li&gt;a reference to an actual class: &lt;code&gt;YAHOO.widget.DateNode&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;</span>
<span class="c">     * &lt;li&gt;children: an array containing further node definitions&lt;/li&gt;&lt;/ul&gt;</span>
<span class="c">     * @method buildTreeFromObject</span>
<span class="c">     * @param  oConfig {Array}  array containing a full description of the tree</span>
<span class="c">     * </span>
<span class="c">     */</span>
    <span class="nx">buildTreeFromObject</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">oConfig</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">logger</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">;</span>
        <span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Building tree from object&#39;</span><span class="o">);</span>
        <span class="k">var</span> <span class="nx">build</span> <span class="o">=</span> <span class="k">function</span> <span class="o">(</span><span class="nx">parent</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">i</span><span class="o">,</span> <span class="nx">item</span><span class="o">,</span> <span class="nx">node</span><span class="o">,</span> <span class="nx">children</span><span class="o">,</span> <span class="nx">type</span><span class="o">,</span> <span class="nx">NodeType</span><span class="o">,</span> <span class="nx">ThisType</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="nx">item</span> <span class="o">=</span> <span class="nx">oConfig</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">item</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">TextNode</span><span class="o">(</span><span class="nx">item</span><span class="o">,</span> <span class="nx">parent</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">item</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">children</span> <span class="o">=</span> <span class="nx">item</span><span class="o">.</span><span class="nx">children</span><span class="o">;</span>
                    <span class="nx">delete</span> <span class="nx">item</span><span class="o">.</span><span class="nx">children</span><span class="o">;</span>
                    <span class="nx">type</span> <span class="o">=</span> <span class="nx">item</span><span class="o">.</span><span class="nx">type</span> <span class="o">||</span> <span class="s1">&#39;text&#39;</span><span class="o">;</span>
                    <span class="nx">delete</span> <span class="nx">item</span><span class="o">.</span><span class="nx">type</span><span class="o">;</span>
                    <span class="nx">switch</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">type</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">type</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">())</span> <span class="o">{</span>
                        <span class="nx">case</span> <span class="s1">&#39;text&#39;</span><span class="o">:</span>
                            <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">TextNode</span><span class="o">(</span><span class="nx">item</span><span class="o">,</span> <span class="nx">parent</span><span class="o">);</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;menu&#39;</span><span class="o">:</span>
                            <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">MenuNode</span><span class="o">(</span><span class="nx">item</span><span class="o">,</span> <span class="nx">parent</span><span class="o">);</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">case</span> <span class="s1">&#39;html&#39;</span><span class="o">:</span>
                            <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">HTMLNode</span><span class="o">(</span><span class="nx">item</span><span class="o">,</span> <span class="nx">parent</span><span class="o">);</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="nx">default</span><span class="o">:</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">type</span><span class="o">))</span> <span class="o">{</span>
                                <span class="nx">NodeType</span> <span class="o">=</span> <span class="nx">Widget</span><span class="o">[</span><span class="nx">type</span><span class="o">];</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">NodeType</span> <span class="o">=</span> <span class="nx">type</span><span class="o">;</span>
                            <span class="o">}</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">NodeType</span><span class="o">))</span> <span class="o">{</span>
                                <span class="k">for</span> <span class="o">(</span><span class="nx">ThisType</span> <span class="o">=</span> <span class="nx">NodeType</span><span class="o">;</span> <span class="nx">ThisType</span> <span class="o">&amp;&amp;</span> <span class="nx">ThisType</span> <span class="o">!==</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">Node</span><span class="o">;</span> <span class="nx">ThisType</span> <span class="o">=</span> <span class="nx">ThisType</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">constructor</span><span class="o">)</span> <span class="o">{}</span>
                                <span class="k">if</span> <span class="o">(</span><span class="nx">ThisType</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">NodeType</span><span class="o">(</span><span class="nx">item</span><span class="o">,</span> <span class="nx">parent</span><span class="o">);</span>
                                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                    <span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Invalid type in node definition: &#39;</span> <span class="o">+</span> <span class="nx">type</span><span class="o">,</span><span class="s1">&#39;error&#39;</span><span class="o">);</span>
                                <span class="o">}</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Invalid type in node definition: &#39;</span> <span class="o">+</span> <span class="nx">type</span><span class="o">,</span><span class="s1">&#39;error&#39;</span><span class="o">);</span>
                            <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">children</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">build</span><span class="o">(</span><span class="nx">node</span><span class="o">,</span><span class="nx">children</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Invalid node definition&#39;</span><span class="o">,</span><span class="s1">&#39;error&#39;</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">};</span>
                            
                    
        <span class="nx">build</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">,</span><span class="nx">oConfig</span><span class="o">);</span>
    <span class="o">},</span>
<span class="c">/**</span>
<span class="c">     * Builds the TreeView from existing markup.   Markup should consist of &amp;lt;UL&amp;gt; or &amp;lt;OL&amp;gt; elements containing &amp;lt;LI&amp;gt; elements.  </span>
<span class="c">     * Each &amp;lt;LI&amp;gt; can have one element used as label and a second optional element which is to be a &amp;lt;UL&amp;gt; or &amp;lt;OL&amp;gt;</span>
<span class="c">     * containing nested nodes.</span>
<span class="c">     * Depending on what the first element of the &amp;lt;LI&amp;gt; element is, the following Nodes will be created: &lt;ul&gt;</span>
<span class="c">     *           &lt;li&gt;plain text:  a regular TextNode&lt;/li&gt;</span>
<span class="c">     *           &lt;li&gt;anchor &amp;lt;A&amp;gt;: a TextNode with its &lt;code&gt;href&lt;/code&gt; and &lt;code&gt;target&lt;/code&gt; taken from the anchor&lt;/li&gt;</span>
<span class="c">     *           &lt;li&gt;anything else: an HTMLNode&lt;/li&gt;&lt;/ul&gt;</span>
<span class="c">     * Only the first  outermost (un-)ordered list in the markup and its children will be parsed.</span>
<span class="c">     * Nodes will be collapsed unless  an  &amp;lt;LI&amp;gt;  tag has a className called &#39;expanded&#39;.</span>
<span class="c">     * All other className attributes will be copied over to the Node className property.</span>
<span class="c">     * If the &amp;lt;LI&amp;gt; element contains an attribute called &lt;code&gt;yuiConfig&lt;/code&gt;, its contents should be a JSON-encoded object</span>
<span class="c">     * as the one used in method &lt;a href=&quot;#method_buildTreeFromObject&quot;&gt;buildTreeFromObject&lt;/a&gt;.</span>
<span class="c">     * @method buildTreeFromMarkup</span>
<span class="c">     * @param  id{string|HTMLElement} The id of the element that contains the markup or a reference to it.</span>
<span class="c">     */</span>
    <span class="nx">buildTreeFromMarkup</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Building tree from existing markup&#39;</span><span class="o">);</span>
        <span class="k">var</span> <span class="nx">build</span> <span class="o">=</span> <span class="k">function</span> <span class="o">(</span><span class="nx">markup</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">el</span><span class="o">,</span> <span class="nx">child</span><span class="o">,</span> <span class="nx">branch</span> <span class="o">=</span> <span class="o">[],</span> <span class="nx">config</span> <span class="o">=</span> <span class="o">{},</span> <span class="k">label</span><span class="o">,</span> <span class="nx">yuiConfig</span><span class="o">;</span>
            <span class="c">// Dom&#39;s getFirstChild and getNextSibling skip over text elements</span>
<span class="c"></span>            <span class="k">for</span> <span class="o">(</span><span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getFirstChild</span><span class="o">(</span><span class="nx">markup</span><span class="o">);</span> <span class="nx">el</span><span class="o">;</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getNextSibling</span><span class="o">(</span><span class="nx">el</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">switch</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
                    <span class="nx">case</span> <span class="s1">&#39;LI&#39;</span><span class="o">:</span>
                        <span class="k">label</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
                        <span class="nx">config</span> <span class="o">=</span> <span class="o">{</span>
                            <span class="nx">expanded</span><span class="o">:</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s1">&#39;expanded&#39;</span><span class="o">),</span>
                            <span class="nx">title</span><span class="o">:</span> <span class="nx">el</span><span class="o">.</span><span class="nx">title</span> <span class="o">||</span> <span class="nx">el</span><span class="o">.</span><span class="nx">alt</span> <span class="o">||</span> <span class="kc">null</span><span class="o">,</span>
                            <span class="nx">className</span><span class="o">:</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">trim</span><span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">className</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\bexpanded\b/</span><span class="o">,</span><span class="s1">&#39;&#39;</span><span class="o">))</span> <span class="o">||</span> <span class="kc">null</span>
                        <span class="o">};</span>
                        <span class="c">// I cannot skip over text elements here because I want them for labels</span>
<span class="c"></span>                        <span class="nx">child</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">nodeType</span> <span class="o">==</span> <span class="m">3</span><span class="o">)</span> <span class="o">{</span>
                            <span class="c">// nodes with only whitespace, tabs and new lines don&#39;t count, they are probably just formatting.</span>
<span class="c"></span>                            <span class="k">label</span> <span class="o">=</span> <span class="nx">Lang</span><span class="o">.</span><span class="nx">trim</span><span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">nodeValue</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/[\n\t\r]*/g</span><span class="o">,</span><span class="s1">&#39;&#39;</span><span class="o">));</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">label</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;text&#39;</span><span class="o">;</span>
                                <span class="nx">config</span><span class="o">.</span><span class="k">label</span> <span class="o">=</span> <span class="k">label</span><span class="o">;</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">child</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getNextSibling</span><span class="o">(</span><span class="nx">child</span><span class="o">);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="k">label</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;A&#39;</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;text&#39;</span><span class="o">;</span>
                                <span class="nx">config</span><span class="o">.</span><span class="k">label</span> <span class="o">=</span> <span class="nx">child</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">href</span> <span class="o">=</span> <span class="nx">child</span><span class="o">.</span><span class="nx">href</span><span class="o">;</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">target</span> <span class="o">=</span> <span class="nx">child</span><span class="o">.</span><span class="nx">target</span><span class="o">;</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">title</span> <span class="o">=</span> <span class="nx">child</span><span class="o">.</span><span class="nx">title</span> <span class="o">||</span> <span class="nx">child</span><span class="o">.</span><span class="nx">alt</span> <span class="o">||</span> <span class="nx">config</span><span class="o">.</span><span class="nx">title</span><span class="o">;</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;html&#39;</span><span class="o">;</span>
                                <span class="k">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
                                <span class="nx">d</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">child</span><span class="o">.</span><span class="nx">cloneNode</span><span class="o">(</span><span class="kc">true</span><span class="o">));</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">html</span> <span class="o">=</span> <span class="nx">d</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">hasIcon</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="c">// see if after the label it has a further list which will become children of this node.</span>
<span class="c"></span>                        <span class="nx">child</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getNextSibling</span><span class="o">(</span><span class="nx">child</span><span class="o">);</span>
                        <span class="nx">switch</span> <span class="o">(</span><span class="nx">child</span> <span class="o">&amp;&amp;</span> <span class="nx">child</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">())</span> <span class="o">{</span>
                            <span class="nx">case</span> <span class="s1">&#39;UL&#39;</span><span class="o">:</span>
                            <span class="nx">case</span> <span class="s1">&#39;OL&#39;</span><span class="o">:</span>
                                <span class="nx">config</span><span class="o">.</span><span class="nx">children</span> <span class="o">=</span> <span class="nx">build</span><span class="o">(</span><span class="nx">child</span><span class="o">);</span>
                                <span class="k">break</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="c">// if there are further elements or text, it will be ignored.</span>
<span class="c"></span>                        
                        <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">JSON</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">yuiConfig</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">getAttribute</span><span class="o">(</span><span class="s1">&#39;yuiConfig&#39;</span><span class="o">);</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">yuiConfig</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">yuiConfig</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">JSON</span><span class="o">.</span><span class="nx">parse</span><span class="o">(</span><span class="nx">yuiConfig</span><span class="o">);</span>
                                <span class="nx">config</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">merge</span><span class="o">(</span><span class="nx">config</span><span class="o">,</span><span class="nx">yuiConfig</span><span class="o">);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        
                        <span class="nx">branch</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">config</span><span class="o">);</span>
                        <span class="k">break</span><span class="o">;</span>
                    <span class="nx">case</span> <span class="s1">&#39;UL&#39;</span><span class="o">:</span>
                    <span class="nx">case</span> <span class="s1">&#39;OL&#39;</span><span class="o">:</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;ULs or OLs can only contain LI elements, not other UL or OL.  This will not work in some browsers&#39;</span><span class="o">,</span><span class="s1">&#39;error&#39;</span><span class="o">);</span>
                        <span class="nx">config</span> <span class="o">=</span> <span class="o">{</span>
                            <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;text&#39;</span><span class="o">,</span>
                            <span class="k">label</span><span class="o">:</span> <span class="s1">&#39;&#39;</span><span class="o">,</span>
                            <span class="nx">children</span><span class="o">:</span> <span class="nx">build</span><span class="o">(</span><span class="nx">child</span><span class="o">)</span>
                        <span class="o">};</span>
                        <span class="nx">branch</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">config</span><span class="o">);</span>
                        <span class="k">break</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">branch</span><span class="o">;</span>
        <span class="o">};</span>

        <span class="k">var</span> <span class="nx">markup</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getChildrenBy</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">id</span><span class="o">),</span><span class="k">function</span> <span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span> 
            <span class="k">var</span> <span class="nx">tag</span> <span class="o">=</span> <span class="nx">el</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">();</span>
            <span class="k">return</span>  <span class="nx">tag</span> <span class="o">==</span> <span class="s1">&#39;UL&#39;</span> <span class="o">||</span> <span class="nx">tag</span> <span class="o">==</span> <span class="s1">&#39;OL&#39;</span><span class="o">;</span>
        <span class="o">});</span>
        <span class="k">if</span> <span class="o">(</span><span class="nx">markup</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">buildTreeFromObject</span><span class="o">(</span><span class="nx">build</span><span class="o">(</span><span class="nx">markup</span><span class="o">[</span><span class="m">0</span><span class="o">]));</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Markup contains no UL or OL elements&#39;</span><span class="o">,</span><span class="s1">&#39;warn&#39;</span><span class="o">);</span>
        <span class="o">}</span>
    <span class="o">},</span>
  <span class="c">/**</span>
<span class="c">     * Returns the TD element where the event has occurred</span>
<span class="c">     * @method _getEventTargetTdEl</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_getEventTargetTdEl</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span> 
        <span class="c">// go up looking for a TD with a className with a ygtv prefix</span>
<span class="c"></span>        <span class="k">while</span> <span class="o">(</span><span class="nx">target</span> <span class="o">&amp;&amp;</span> <span class="o">!(</span><span class="nx">target</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;TD&#39;</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span><span class="s1">&#39;ygtvrow&#39;</span><span class="o">)))</span> <span class="o">{</span> 
            <span class="nx">target</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getAncestorByTagName</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span><span class="s1">&#39;td&#39;</span><span class="o">);</span> 
        <span class="o">}</span>
        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNull</span><span class="o">(</span><span class="nx">target</span><span class="o">))</span> <span class="o">{</span> <span class="k">return</span> <span class="kc">null</span><span class="o">;</span> <span class="o">}</span>
        <span class="c">// If it is a spacer cell, do nothing</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="sr">/\bygtv(blank)?depthcell/</span><span class="o">.</span><span class="nx">test</span><span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">className</span><span class="o">))</span> <span class="o">{</span> <span class="k">return</span> <span class="kc">null</span><span class="o">;}</span>
        <span class="c">// If it has an id, search for the node number and see if it belongs to a node in this tree.</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">id</span><span class="o">.</span><span class="nx">match</span><span class="o">(</span><span class="sr">/\bygtv([^\d]*)(.*)/</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">m</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="o">[</span><span class="m">2</span><span class="o">]</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">[</span><span class="nx">m</span><span class="o">[</span><span class="m">2</span><span class="o">]])</span> <span class="o">{</span>
                <span class="k">return</span> <span class="nx">target</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>
  <span class="c">/**</span>
<span class="c">     * Event listener for click events</span>
<span class="c">     * @method _onClickEvent</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_onClickEvent</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
            <span class="nx">td</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getEventTargetTdEl</span><span class="o">(</span><span class="nx">ev</span><span class="o">),</span>
            <span class="nx">node</span><span class="o">,</span>
            <span class="nx">target</span><span class="o">,</span>
            <span class="nx">toggle</span> <span class="o">=</span> <span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
                <span class="nx">node</span><span class="o">.</span><span class="nx">toggle</span><span class="o">();</span>
                <span class="nx">node</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span>
                <span class="k">try</span> <span class="o">{</span>
                    <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c">// @TODO</span>
<span class="c"></span>                    <span class="c">// For some reason IE8 is providing an event object with</span>
<span class="c"></span>                    <span class="c">// most of the fields missing, but only when clicking on</span>
<span class="c"></span>                    <span class="c">// the node&#39;s label, and only when working with inline</span>
<span class="c"></span>                    <span class="c">// editing.  This generates a &quot;Member not found&quot; error</span>
<span class="c"></span>                    <span class="c">// in that browser.  Determine if this is a browser</span>
<span class="c"></span>                    <span class="c">// bug, or a problem with this code.  Already checked to</span>
<span class="c"></span>                    <span class="c">// see if the problem has to do with access the event</span>
<span class="c"></span>                    <span class="c">// in the outer scope, and that isn&#39;t the problem.</span>
<span class="c"></span>                    <span class="c">// Maybe the markup for inline editing is broken.</span>
<span class="c"></span>                <span class="o">}</span>
            <span class="o">};</span>

        <span class="k">if</span> <span class="o">(!</span><span class="nx">td</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span><span class="o">;</span> 
        <span class="o">}</span>

        <span class="nx">node</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getNodeByElement</span><span class="o">(</span><span class="nx">td</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(!</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span> 
            <span class="k">return</span><span class="o">;</span> 
        <span class="o">}</span>
        
        <span class="c">// exception to handle deprecated event labelClick</span>
<span class="c"></span>        <span class="c">// @TODO take another look at this deprecation.  It is common for people to</span>
<span class="c"></span>        <span class="c">// only be interested in the label click, so why make them have to test</span>
<span class="c"></span>        <span class="c">// the node type to figure out whether the click was on the label?</span>
<span class="c"></span>        <span class="nx">target</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="nx">node</span><span class="o">.</span><span class="nx">labelStyle</span><span class="o">)</span> <span class="o">||</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getAncestorByClassName</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span><span class="nx">node</span><span class="o">.</span><span class="nx">labelStyle</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;onLabelClick &quot;</span> <span class="o">+</span> <span class="nx">node</span><span class="o">.</span><span class="k">label</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;labelClick&#39;</span><span class="o">,</span><span class="nx">node</span><span class="o">);</span>
        <span class="o">}</span>
        
        <span class="c">//  If it is a toggle cell, toggle</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="sr">/\bygtv[tl][mp]h?h?/</span><span class="o">.</span><span class="nx">test</span><span class="o">(</span><span class="nx">td</span><span class="o">.</span><span class="nx">className</span><span class="o">))</span> <span class="o">{</span>
            <span class="nx">toggle</span><span class="o">();</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dblClickTimer</span><span class="o">)</span> <span class="o">{</span>
                <span class="nb">window</span><span class="o">.</span><span class="nx">clearTimeout</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dblClickTimer</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_dblClickTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasDblClickSubscriber</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">_dblClickTimer</span> <span class="o">=</span> <span class="nb">window</span><span class="o">.</span><span class="nx">setTimeout</span><span class="o">(</span><span class="k">function</span> <span class="o">()</span> <span class="o">{</span>
                        <span class="nx">self</span><span class="o">.</span><span class="nx">_dblClickTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">self</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;clickEvent&#39;</span><span class="o">,</span> <span class="o">{</span><span class="nx">event</span><span class="o">:</span><span class="nx">ev</span><span class="o">,</span><span class="nx">node</span><span class="o">:</span><span class="nx">node</span><span class="o">})</span> <span class="o">!==</span> <span class="kc">false</span><span class="o">)</span> <span class="o">{</span> 
                            <span class="nx">toggle</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">},</span> <span class="m">200</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">self</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;clickEvent&#39;</span><span class="o">,</span> <span class="o">{</span><span class="nx">event</span><span class="o">:</span><span class="nx">ev</span><span class="o">,</span><span class="nx">node</span><span class="o">:</span><span class="nx">node</span><span class="o">})</span> <span class="o">!==</span> <span class="kc">false</span><span class="o">)</span> <span class="o">{</span> 
                        <span class="nx">toggle</span><span class="o">();</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">},</span>

  <span class="c">/**</span>
<span class="c">     * Event listener for double-click events</span>
<span class="c">     * @method _onDblClickEvent</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_onDblClickEvent</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasDblClickSubscriber</span><span class="o">)</span> <span class="o">{</span> <span class="k">return</span><span class="o">;</span> <span class="o">}</span>
        <span class="k">var</span> <span class="nx">td</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getEventTargetTdEl</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(!</span><span class="nx">td</span><span class="o">)</span> <span class="o">{</span><span class="k">return</span><span class="o">;}</span>

        <span class="k">if</span> <span class="o">(!(</span><span class="sr">/\bygtv[tl][mp]h?h?/</span><span class="o">.</span><span class="nx">test</span><span class="o">(</span><span class="nx">td</span><span class="o">.</span><span class="nx">className</span><span class="o">)))</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;dblClickEvent&#39;</span><span class="o">,</span> <span class="o">{</span><span class="nx">event</span><span class="o">:</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">node</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">getNodeByElement</span><span class="o">(</span><span class="nx">td</span><span class="o">)});</span> 
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dblClickTimer</span><span class="o">)</span> <span class="o">{</span>
                <span class="nb">window</span><span class="o">.</span><span class="nx">clearTimeout</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dblClickTimer</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_dblClickTimer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">}</span>
    <span class="o">},</span>
  <span class="c">/**</span>
<span class="c">     * Event listener for mouse over events</span>
<span class="c">     * @method _onMouseOverEvent</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_onMouseOverEvent</span><span class="o">:</span><span class="k">function</span> <span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">target</span><span class="o">;</span>
        <span class="k">if</span> <span class="o">((</span><span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getEventTargetTdEl</span><span class="o">(</span><span class="nx">ev</span><span class="o">))</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getNodeByElement</span><span class="o">(</span><span class="nx">target</span><span class="o">))</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">target</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">getToggleEl</span><span class="o">()))</span> <span class="o">{</span>
            <span class="nx">target</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">className</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\bygtv([lt])([mp])\b/gi</span><span class="o">,</span><span class="s1">&#39;ygtv$1$2h&#39;</span><span class="o">);</span>
        <span class="o">}</span>
    <span class="o">},</span>
  <span class="c">/**</span>
<span class="c">     * Event listener for mouse out events</span>
<span class="c">     * @method _onMouseOutEvent</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_onMouseOutEvent</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">target</span><span class="o">;</span>
        <span class="k">if</span> <span class="o">((</span><span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_getEventTargetTdEl</span><span class="o">(</span><span class="nx">ev</span><span class="o">))</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getNodeByElement</span><span class="o">(</span><span class="nx">target</span><span class="o">))</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">target</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">getToggleEl</span><span class="o">()))</span> <span class="o">{</span>
            <span class="nx">target</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">className</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/\bygtv([lt])([mp])h\b/gi</span><span class="o">,</span><span class="s1">&#39;ygtv$1$2&#39;</span><span class="o">);</span>
        <span class="o">}</span>
    <span class="o">},</span>
  <span class="c">/**</span>
<span class="c">     * Event listener for key down events</span>
<span class="c">     * @method _onKeyDownEvent</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_onKeyDownEvent</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">),</span>
            <span class="nx">node</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getNodeByElement</span><span class="o">(</span><span class="nx">target</span><span class="o">),</span>
            <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">node</span><span class="o">,</span>
            <span class="nx">KEY</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">KeyListener</span><span class="o">.</span><span class="nx">KEY</span><span class="o">;</span>

        <span class="nx">switch</span><span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">case</span> <span class="nx">KEY</span><span class="o">.</span><span class="nx">UP</span><span class="o">:</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;UP&#39;</span><span class="o">);</span>
                <span class="k">do</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">previousSibling</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">previousSibling</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">while</span> <span class="o">(</span><span class="nx">newNode</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">_canHaveFocus</span><span class="o">());</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">)</span> <span class="o">{</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span> <span class="o">}</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">case</span> <span class="nx">KEY</span><span class="o">.</span><span class="nx">DOWN</span><span class="o">:</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;DOWN&#39;</span><span class="o">);</span>
                <span class="k">do</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">newNode</span><span class="o">.</span><span class="nx">expand</span><span class="o">();</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">children</span><span class="o">.</span><span class="nx">length</span> <span class="o">||</span> <span class="kc">null</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">children</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">while</span> <span class="o">(</span><span class="nx">newNode</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">_canHaveFocus</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">)</span> <span class="o">{</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">focus</span><span class="o">();}</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">case</span> <span class="nx">KEY</span><span class="o">.</span><span class="nx">LEFT</span><span class="o">:</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;LEFT&#39;</span><span class="o">);</span>
                <span class="k">do</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">previousSibling</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">while</span> <span class="o">(</span><span class="nx">newNode</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">_canHaveFocus</span><span class="o">());</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">)</span> <span class="o">{</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">focus</span><span class="o">();}</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">case</span> <span class="nx">KEY</span><span class="o">.</span><span class="nx">RIGHT</span><span class="o">:</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;RIGHT&#39;</span><span class="o">);</span>
                <span class="k">do</span> <span class="o">{</span>
                    <span class="nx">newNode</span><span class="o">.</span><span class="nx">expand</span><span class="o">();</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">children</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">children</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">while</span> <span class="o">(</span><span class="nx">newNode</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">_canHaveFocus</span><span class="o">());</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">)</span> <span class="o">{</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">focus</span><span class="o">();}</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">case</span> <span class="nx">KEY</span><span class="o">.</span><span class="nx">ENTER</span><span class="o">:</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;ENTER: &#39;</span> <span class="o">+</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">href</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">href</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">target</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nb">window</span><span class="o">.</span><span class="nx">open</span><span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">href</span><span class="o">,</span><span class="nx">node</span><span class="o">.</span><span class="nx">target</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nb">window</span><span class="o">.</span><span class="nx">location</span><span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">href</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">node</span><span class="o">.</span><span class="nx">toggle</span><span class="o">();</span>
                <span class="o">}</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;enterKeyPressed&#39;</span><span class="o">,</span><span class="nx">node</span><span class="o">);</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">case</span> <span class="nx">KEY</span><span class="o">.</span><span class="nx">HOME</span><span class="o">:</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;HOME&#39;</span><span class="o">);</span>
                <span class="nx">newNode</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">();</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">children</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span><span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">children</span><span class="o">[</span><span class="m">0</span><span class="o">];}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">_canHaveFocus</span><span class="o">())</span> <span class="o">{</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span> <span class="o">}</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">case</span> <span class="nx">KEY</span><span class="o">.</span><span class="nx">END</span><span class="o">:</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;END&#39;</span><span class="o">);</span>
                <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">children</span><span class="o">;</span>
                <span class="nx">newNode</span> <span class="o">=</span> <span class="nx">newNode</span><span class="o">[</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">length</span> <span class="o">-</span><span class="m">1</span><span class="o">];</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">newNode</span><span class="o">.</span><span class="nx">_canHaveFocus</span><span class="o">())</span> <span class="o">{</span> <span class="nx">newNode</span><span class="o">.</span><span class="nx">focus</span><span class="o">();</span> <span class="o">}</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="c">// case KEY.PAGE_UP:</span>
<span class="c"></span>                <span class="c">// this.logger.log(&#39;PAGE_UP&#39;);</span>
<span class="c"></span>                <span class="c">// break;</span>
<span class="c"></span>            <span class="c">// case KEY.PAGE_DOWN:</span>
<span class="c"></span>                <span class="c">// this.logger.log(&#39;PAGE_DOWN&#39;);</span>
<span class="c"></span>                <span class="c">// break;</span>
<span class="c"></span>            <span class="nx">case</span> <span class="m">107</span><span class="o">:</span>  <span class="c">// plus key</span>
<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Shift-PLUS&#39;</span><span class="o">);</span>
                    <span class="nx">node</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">expandAll</span><span class="o">();</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;PLUS&#39;</span><span class="o">);</span>
                    <span class="nx">node</span><span class="o">.</span><span class="nx">expand</span><span class="o">();</span>
                <span class="o">}</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">case</span> <span class="m">109</span><span class="o">:</span> <span class="c">// minus key</span>
<span class="c"></span>                <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Shift-MINUS&#39;</span><span class="o">);</span>
                    <span class="nx">node</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">collapseAll</span><span class="o">();</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;MINUS&#39;</span><span class="o">);</span>
                    <span class="nx">node</span><span class="o">.</span><span class="nx">collapse</span><span class="o">();</span>
                <span class="o">}</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="nx">default</span><span class="o">:</span>
                <span class="k">break</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">},</span>
    <span class="c">/**</span>
<span class="c">     * Renders the tree boilerplate and visible nodes</span>
<span class="c">     * @method render</span>
<span class="c">     */</span>
    <span class="nx">render</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">.</span><span class="nx">getHtml</span><span class="o">(),</span>
            <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getEl</span><span class="o">();</span>
        <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">html</span><span class="o">;</span>
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_hasEvents</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onClickEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;dblclick&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onDblClickEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;mouseover&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onMouseOverEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;mouseout&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onMouseOutEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="s1">&#39;keydown&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_onKeyDownEvent</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="o">}</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_hasEvents</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">},</span>
    
  <span class="c">/**</span>
<span class="c">     * Returns the tree&#39;s host element</span>
<span class="c">     * @method getEl</span>
<span class="c">     * @return {HTMLElement} the host element</span>
<span class="c">     */</span>
    <span class="nx">getEl</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(!</span> <span class="k">this</span><span class="o">.</span><span class="nx">_el</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_el</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Nodes register themselves with the tree instance when they are created.</span>
<span class="c">     * @method regNode</span>
<span class="c">     * @param node {Node} the node to register</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">regNode</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">[</span><span class="nx">node</span><span class="o">.</span><span class="nx">index</span><span class="o">]</span> <span class="o">=</span> <span class="nx">node</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns the root node of this tree</span>
<span class="c">     * @method getRoot</span>
<span class="c">     * @return {Node} the root node</span>
<span class="c">     */</span>
    <span class="nx">getRoot</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Configures this tree to dynamically load all child data</span>
<span class="c">     * @method setDynamicLoad</span>
<span class="c">     * @param {function} fnDataLoader the function that will be called to get the data</span>
<span class="c">     * @param iconMode {int} configures the icon that is displayed when a dynamic</span>
<span class="c">     * load node is expanded the first time without children.  By default, the </span>
<span class="c">     * &quot;collapse&quot; icon will be used.  If set to 1, the leaf node icon will be</span>
<span class="c">     * displayed.</span>
<span class="c">     */</span>
    <span class="nx">setDynamicLoad</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">fnDataLoader</span><span class="o">,</span> <span class="nx">iconMode</span><span class="o">)</span> <span class="o">{</span> 
        <span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">.</span><span class="nx">setDynamicLoad</span><span class="o">(</span><span class="nx">fnDataLoader</span><span class="o">,</span> <span class="nx">iconMode</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Expands all child nodes.  Note: this conflicts with the &quot;multiExpand&quot;</span>
<span class="c">     * node property.  If expand all is called in a tree with nodes that</span>
<span class="c">     * do not allow multiple siblings to be displayed, only the last sibling</span>
<span class="c">     * will be expanded.</span>
<span class="c">     * @method expandAll</span>
<span class="c">     */</span>
    <span class="nx">expandAll</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">locked</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">.</span><span class="nx">expandAll</span><span class="o">();</span> 
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Collapses all expanded child nodes in the entire tree.</span>
<span class="c">     * @method collapseAll</span>
<span class="c">     */</span>
    <span class="nx">collapseAll</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> 
        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">locked</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">.</span><span class="nx">collapseAll</span><span class="o">();</span> 
        <span class="o">}</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns a node in the tree that has the specified index (this index</span>
<span class="c">     * is created internally, so this function probably will only be used</span>
<span class="c">     * in html generated for a given node.)</span>
<span class="c">     * @method getNodeByIndex</span>
<span class="c">     * @param {int} nodeIndex the index of the node wanted</span>
<span class="c">     * @return {Node} the node with index=nodeIndex, null if no match</span>
<span class="c">     */</span>
    <span class="nx">getNodeByIndex</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">nodeIndex</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">n</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">[</span><span class="nx">nodeIndex</span><span class="o">];</span>
        <span class="k">return</span> <span class="o">(</span><span class="nx">n</span><span class="o">)</span> <span class="o">?</span> <span class="nx">n</span> <span class="o">:</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns a node that has a matching property and value in the data</span>
<span class="c">     * object that was passed into its constructor.</span>
<span class="c">     * @method getNodeByProperty</span>
<span class="c">     * @param {object} property the property to search (usually a string)</span>
<span class="c">     * @param {object} value the value we want to find (usuall an int or string)</span>
<span class="c">     * @return {Node} the matching node, null if no match</span>
<span class="c">     */</span>
    <span class="nx">getNodeByProperty</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">property</span><span class="o">,</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">n</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="k">if</span> <span class="o">((</span><span class="nx">property</span> <span class="k">in</span> <span class="nx">n</span> <span class="o">&amp;&amp;</span> <span class="nx">n</span><span class="o">[</span><span class="nx">property</span><span class="o">]</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">n</span><span class="o">.</span><span class="nx">data</span> <span class="o">&amp;&amp;</span> <span class="nx">value</span> <span class="o">==</span> <span class="nx">n</span><span class="o">.</span><span class="nx">data</span><span class="o">[</span><span class="nx">property</span><span class="o">]))</span> <span class="o">{</span>
                    <span class="k">return</span> <span class="nx">n</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns a collection of nodes that have a matching property </span>
<span class="c">     * and value in the data object that was passed into its constructor.  </span>
<span class="c">     * @method getNodesByProperty</span>
<span class="c">     * @param {object} property the property to search (usually a string)</span>
<span class="c">     * @param {object} value the value we want to find (usuall an int or string)</span>
<span class="c">     * @return {Array} the matching collection of nodes, null if no match</span>
<span class="c">     */</span>
    <span class="nx">getNodesByProperty</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">property</span><span class="o">,</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">values</span> <span class="o">=</span> <span class="o">[];</span>
        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">n</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="k">if</span> <span class="o">((</span><span class="nx">property</span> <span class="k">in</span> <span class="nx">n</span> <span class="o">&amp;&amp;</span> <span class="nx">n</span><span class="o">[</span><span class="nx">property</span><span class="o">]</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">n</span><span class="o">.</span><span class="nx">data</span> <span class="o">&amp;&amp;</span> <span class="nx">value</span> <span class="o">==</span> <span class="nx">n</span><span class="o">.</span><span class="nx">data</span><span class="o">[</span><span class="nx">property</span><span class="o">]))</span> <span class="o">{</span>
                    <span class="nx">values</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">n</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="o">(</span><span class="nx">values</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">?</span> <span class="nx">values</span> <span class="o">:</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns the treeview node reference for an anscestor element</span>
<span class="c">     * of the node, or null if it is not contained within any node</span>
<span class="c">     * in this tree.</span>
<span class="c">     * @method getNodeByElement</span>
<span class="c">     * @param {HTMLElement} the element to test</span>
<span class="c">     * @return {YAHOO.widget.Node} a node reference or null</span>
<span class="c">     */</span>
    <span class="nx">getNodeByElement</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">{</span>

        <span class="k">var</span> <span class="nx">p</span><span class="o">=</span><span class="nx">el</span><span class="o">,</span> <span class="nx">m</span><span class="o">,</span> <span class="nx">re</span><span class="o">=</span><span class="sr">/ygtv([^\d]*)(.*)/</span><span class="o">;</span>

        <span class="k">do</span> <span class="o">{</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">p</span> <span class="o">&amp;&amp;</span> <span class="nx">p</span><span class="o">.</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">m</span> <span class="o">=</span> <span class="nx">p</span><span class="o">.</span><span class="nx">id</span><span class="o">.</span><span class="nx">match</span><span class="o">(</span><span class="nx">re</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">m</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="o">[</span><span class="m">2</span><span class="o">])</span> <span class="o">{</span>
                    <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getNodeByIndex</span><span class="o">(</span><span class="nx">m</span><span class="o">[</span><span class="m">2</span><span class="o">]);</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="nx">p</span> <span class="o">=</span> <span class="nx">p</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(!</span><span class="nx">p</span> <span class="o">||</span> <span class="o">!</span><span class="nx">p</span><span class="o">.</span><span class="nx">tagName</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">break</span><span class="o">;</span>
            <span class="o">}</span>

        <span class="o">}</span> 
        <span class="k">while</span> <span class="o">(</span><span class="nx">p</span><span class="o">.</span><span class="nx">id</span> <span class="o">!==</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">&amp;&amp;</span> <span class="nx">p</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">!==</span> <span class="s2">&quot;body&quot;</span><span class="o">);</span>

        <span class="k">return</span> <span class="kc">null</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Removes the node and its children, and optionally refreshes the </span>
<span class="c">     * branch of the tree that was affected.</span>
<span class="c">     * @method removeNode</span>
<span class="c">     * @param {Node} The node to remove</span>
<span class="c">     * @param {boolean} autoRefresh automatically refreshes branch if true</span>
<span class="c">     * @return {boolean} False is there was a problem, true otherwise.</span>
<span class="c">     */</span>
    <span class="nx">removeNode</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">,</span> <span class="nx">autoRefresh</span><span class="o">)</span> <span class="o">{</span> 

        <span class="c">// Don&#39;t delete the root node</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">isRoot</span><span class="o">())</span> <span class="o">{</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="c">// Get the branch that we may need to refresh</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">p</span> <span class="o">=</span> <span class="nx">node</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
        <span class="k">if</span> <span class="o">(</span><span class="nx">p</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">p</span> <span class="o">=</span> <span class="nx">p</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="c">// Delete the node and its children</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">_deleteNode</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span>

        <span class="c">// Refresh the parent of the parent</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="nx">autoRefresh</span> <span class="o">&amp;&amp;</span> <span class="nx">p</span> <span class="o">&amp;&amp;</span> <span class="nx">p</span><span class="o">.</span><span class="nx">childrenRendered</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">p</span><span class="o">.</span><span class="nx">refresh</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * wait until the animation is complete before deleting </span>
<span class="c">     * to avoid javascript errors</span>
<span class="c">     * @method _removeChildren_animComplete</span>
<span class="c">     * @param o the custom event payload</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_removeChildren_animComplete</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">unsubscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_removeChildren_animComplete</span><span class="o">);</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">removeChildren</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">node</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Deletes this nodes child collection, recursively.  Also collapses</span>
<span class="c">     * the node, and resets the dynamic load flag.  The primary use for</span>
<span class="c">     * this method is to purge a node and allow it to fetch its data</span>
<span class="c">     * dynamically again.</span>
<span class="c">     * @method removeChildren</span>
<span class="c">     * @param {Node} node the node to purge</span>
<span class="c">     */</span>
    <span class="nx">removeChildren</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span> 

        <span class="k">if</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">expanded</span><span class="o">)</span> <span class="o">{</span>
            <span class="c">// wait until the animation is complete before deleting to</span>
<span class="c"></span>            <span class="c">// avoid javascript errors</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_collapseAnim</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="s2">&quot;animComplete&quot;</span><span class="o">,</span> 
                        <span class="k">this</span><span class="o">.</span><span class="nx">_removeChildren_animComplete</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                <span class="nx">Widget</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">collapse</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span>
                <span class="k">return</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="nx">node</span><span class="o">.</span><span class="nx">collapse</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Removing children for &quot;</span> <span class="o">+</span> <span class="nx">node</span><span class="o">);</span>
        <span class="k">while</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">children</span><span class="o">.</span><span class="nx">length</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_deleteNode</span><span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">children</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">isRoot</span><span class="o">())</span> <span class="o">{</span>
            <span class="nx">Widget</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">expand</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span>
        <span class="o">}</span>

        <span class="nx">node</span><span class="o">.</span><span class="nx">childrenRendered</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
        <span class="nx">node</span><span class="o">.</span><span class="nx">dynamicLoadComplete</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

        <span class="nx">node</span><span class="o">.</span><span class="nx">updateIcon</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Deletes the node and recurses children</span>
<span class="c">     * @method _deleteNode</span>
<span class="c">     * @private</span>
<span class="c">     */</span>
    <span class="nx">_deleteNode</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span> 
        <span class="c">// Remove all the child nodes first</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">removeChildren</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span>

        <span class="c">// Remove the node from the tree</span>
<span class="c"></span>        <span class="k">this</span><span class="o">.</span><span class="nx">popNode</span><span class="o">(</span><span class="nx">node</span><span class="o">);</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Removes the node from the tree, preserving the child collection </span>
<span class="c">     * to make it possible to insert the branch into another part of the </span>
<span class="c">     * tree, or another tree.</span>
<span class="c">     * @method popNode</span>
<span class="c">     * @param {Node} the node to remove</span>
<span class="c">     */</span>
    <span class="nx">popNode</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span> 
        <span class="k">var</span> <span class="nx">p</span> <span class="o">=</span> <span class="nx">node</span><span class="o">.</span><span class="nx">parent</span><span class="o">;</span>

        <span class="c">// Update the parent&#39;s collection of children</span>
<span class="c"></span>        <span class="k">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="o">[];</span>

        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">p</span><span class="o">.</span><span class="nx">children</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="o">;++</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">p</span><span class="o">.</span><span class="nx">children</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">!=</span> <span class="nx">node</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">a</span><span class="o">[</span><span class="nx">a</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">p</span><span class="o">.</span><span class="nx">children</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="nx">p</span><span class="o">.</span><span class="nx">children</span> <span class="o">=</span> <span class="nx">a</span><span class="o">;</span>

        <span class="c">// reset the childrenRendered flag for the parent</span>
<span class="c"></span>        <span class="nx">p</span><span class="o">.</span><span class="nx">childrenRendered</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

         <span class="c">// Update the sibling relationship</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">previousSibling</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">node</span><span class="o">.</span><span class="nx">previousSibling</span><span class="o">.</span><span class="nx">nextSibling</span> <span class="o">=</span> <span class="nx">node</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="nx">node</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">node</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">.</span><span class="nx">previousSibling</span> <span class="o">=</span> <span class="nx">node</span><span class="o">.</span><span class="nx">previousSibling</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="nx">node</span><span class="o">.</span><span class="nx">parent</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
        <span class="nx">node</span><span class="o">.</span><span class="nx">previousSibling</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
        <span class="nx">node</span><span class="o">.</span><span class="nx">nextSibling</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
        <span class="nx">node</span><span class="o">.</span><span class="nx">tree</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

        <span class="c">// Update the tree&#39;s node collection </span>
<span class="c"></span>        <span class="nx">delete</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">[</span><span class="nx">node</span><span class="o">.</span><span class="nx">index</span><span class="o">];</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">    * Nulls out the entire TreeView instance and related objects, removes attached</span>
<span class="c">    * event listeners, and clears out DOM elements inside the container. After</span>
<span class="c">    * calling this method, the instance reference should be expliclitly nulled by</span>
<span class="c">    * implementer, as in myDataTable = null. Use with caution!</span>
<span class="c">    *</span>
<span class="c">    * @method destroy</span>
<span class="c">    */</span>
    <span class="nx">destroy</span> <span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="c">// Since the label editor can be separated from the main TreeView control</span>
<span class="c"></span>        <span class="c">// the destroy method for it might not be there.</span>
<span class="c"></span>        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_destroyEditor</span><span class="o">)</span> <span class="o">{</span> <span class="k">this</span><span class="o">.</span><span class="nx">_destroyEditor</span><span class="o">();</span> <span class="o">}</span>
        <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getEl</span><span class="o">();</span>
        <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s1">&#39;click&#39;</span><span class="o">);</span>
        <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s1">&#39;dblclick&#39;</span><span class="o">);</span>
        <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s1">&#39;mouseover&#39;</span><span class="o">);</span>
        <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s1">&#39;mouseout&#39;</span><span class="o">);</span>
        <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span><span class="s1">&#39;keydown&#39;</span><span class="o">);</span>
        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span> <span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">node</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_nodes</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">node</span> <span class="o">&amp;&amp;</span> <span class="nx">node</span><span class="o">.</span><span class="nx">destroy</span><span class="o">)</span> <span class="o">{</span><span class="nx">node</span><span class="o">.</span><span class="nx">destroy</span><span class="o">();</span> <span class="o">}</span>
        <span class="o">}</span>
        <span class="nx">el</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">_hasEvents</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
    <span class="o">},</span>
        
            


    <span class="c">/**</span>
<span class="c">     * TreeView instance toString</span>
<span class="c">     * @method toString</span>
<span class="c">     * @return {string} string representation of the tree</span>
<span class="c">     */</span>
    <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="s2">&quot;TreeView &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Count of nodes in tree</span>
<span class="c">     * @method getNodeCount</span>
<span class="c">     * @return {int} number of nodes in the tree</span>
<span class="c">     */</span>
    <span class="nx">getNodeCount</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">().</span><span class="nx">getNodeCount</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Returns an object which could be used to rebuild the tree.</span>
<span class="c">     * It can be passed to the tree constructor to reproduce the same tree.</span>
<span class="c">     * It will return false if any node loads dynamically, regardless of whether it is loaded or not.</span>
<span class="c">     * @method getTreeDefinition</span>
<span class="c">     * @return {Object | false}  definition of the tree or false if any node is defined as dynamic</span>
<span class="c">     */</span>
    <span class="nx">getTreeDefinition</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getRoot</span><span class="o">().</span><span class="nx">getNodeDefinition</span><span class="o">();</span>
    <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Abstract method that is executed when a node is expanded</span>
<span class="c">     * @method onExpand</span>
<span class="c">     * @param node {Node} the node that was expanded</span>
<span class="c">     * @deprecated use treeobj.subscribe(&quot;expand&quot;) instead</span>
<span class="c">     */</span>
    <span class="nx">onExpand</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span> <span class="o">},</span>

    <span class="c">/**</span>
<span class="c">     * Abstract method that is executed when a node is collapsed.</span>
<span class="c">     * @method onCollapse</span>
<span class="c">     * @param node {Node} the node that was collapsed.</span>
<span class="c">     * @deprecated use treeobj.subscribe(&quot;collapse&quot;) instead</span>
<span class="c">     */</span>
    <span class="nx">onCollapse</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">node</span><span class="o">)</span> <span class="o">{</span> <span class="o">},</span>
    
    <span class="c">/**</span>
<span class="c">    * Sets the value of a property for all loaded nodes in the tree.</span>
<span class="c">    * @method setNodesProperty</span>
<span class="c">    * @param name {string} Name of the property to be set</span>
<span class="c">    * @param value {any} value to be set</span>
<span class="c">    * @param refresh {boolean} if present and true, it does a refresh</span>
<span class="c">    */</span>
    <span class="nx">setNodesProperty</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">name</span><span class="o">,</span> <span class="nx">value</span><span class="o">,</span> <span class="nx">refresh</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">.</span><span class="nx">setNodesProperty</span><span class="o">(</span><span class="nx">name</span><span class="o">,</span><span class="nx">value</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(</span><span class="nx">refresh</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">root</span><span class="o">.</span><span class="nx">refresh</span><span class="o">();</span>
        <span class="o">}</span>
    <span class="o">},</span>
    <span class="c">/**</span>
<span class="c">    * Event listener to toggle node highlight.</span>
<span class="c">    * Can be assigned as listener to clickEvent, dblClickEvent and enterKeyPressed.</span>
<span class="c">    * It returns false to prevent the default action.</span>
<span class="c">    * @method onEventToggleHighlight</span>
<span class="c">    * @param oArgs {any} it takes the arguments of any of the events mentioned above</span>
<span class="c">    * @return {false} Always cancels the default action for the event</span>
<span class="c">    */</span>
    <span class="nx">onEventToggleHighlight</span><span class="o">:</span> <span class="k">function</span> <span class="o">(</span><span class="nx">oArgs</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">var</span> <span class="nx">node</span><span class="o">;</span>
        <span class="k">if</span> <span class="o">(</span><span class="s1">&#39;node&#39;</span> <span class="k">in</span> <span class="nx">oArgs</span> <span class="o">&amp;&amp;</span> <span class="nx">oArgs</span><span class="o">.</span><span class="nx">node</span> <span class="k">instanceof</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">Node</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">node</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="o">.</span><span class="nx">node</span><span class="o">;</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">oArgs</span> <span class="k">instanceof</span> <span class="nx">Widget</span><span class="o">.</span><span class="nx">Node</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">node</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="o">;</span>
        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="nx">node</span><span class="o">.</span><span class="nx">toggleHighlight</span><span class="o">();</span>
        <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
    <span class="o">}</span>
        

<span class="o">};</span>

<span class="c">/* Backwards compatibility aliases */</span>
<span class="k">var</span> <span class="nx">PROT</span> <span class="o">=</span> <span class="nx">TV</span><span class="o">.</span><span class="nx">prototype</span><span class="o">;</span>
 <span class="c">/**</span>
<span class="c">     * Renders the tree boilerplate and visible nodes.</span>
<span class="c">     *  Alias for render</span>
<span class="c">     * @method draw</span>
<span class="c">     * @deprecated Use render instead</span>
<span class="c">     */</span>
<span class="nx">PROT</span><span class="o">.</span><span class="nx">draw</span> <span class="o">=</span> <span class="nx">PROT</span><span class="o">.</span><span class="nx">render</span><span class="o">;</span>

<span class="c">/* end backwards compatibility aliases */</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">augment</span><span class="o">(</span><span class="nx">TV</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">EventProvider</span><span class="o">);</span>

<span class="c">/**</span>
<span class="c"> * Running count of all nodes created in all trees.  This is </span>
<span class="c"> * used to provide unique identifies for all nodes.  Deleting</span>
<span class="c"> * nodes does not change the nodeCount.</span>
<span class="c"> * @property YAHOO.widget.TreeView.nodeCount</span>
<span class="c"> * @type int</span>
<span class="c"> * @static</span>
<span class="c"> */</span>
<span class="nx">TV</span><span class="o">.</span><span class="nx">nodeCount</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c"> * Global cache of tree instances</span>
<span class="c"> * @property YAHOO.widget.TreeView.trees</span>
<span class="c"> * @type Array</span>
<span class="c"> * @static</span>
<span class="c"> * @private</span>
<span class="c"> */</span>
<span class="nx">TV</span><span class="o">.</span><span class="nx">trees</span> <span class="o">=</span> <span class="o">[];</span>

<span class="c">/**</span>
<span class="c"> * Global method for getting a tree by its id.  Used in the generated</span>
<span class="c"> * tree html.</span>
<span class="c"> * @method YAHOO.widget.TreeView.getTree</span>
<span class="c"> * @param treeId {String} the id of the tree instance</span>
<span class="c"> * @return {TreeView} the tree instance requested, null if not found.</span>
<span class="c"> * @static</span>
<span class="c"> */</span>
<span class="nx">TV</span><span class="o">.</span><span class="nx">getTree</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">treeId</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="nx">TV</span><span class="o">.</span><span class="nx">trees</span><span class="o">[</span><span class="nx">treeId</span><span class="o">];</span>
    <span class="k">return</span> <span class="o">(</span><span class="nx">t</span><span class="o">)</span> <span class="o">?</span> <span class="nx">t</span> <span class="o">:</span> <span class="kc">null</span><span class="o">;</span>
<span class="o">};</span>


<span class="c">/**</span>
<span class="c"> * Global method for getting a node by its id.  Used in the generated</span>
<span class="c"> * tree html.</span>
<span class="c"> * @method YAHOO.widget.TreeView.getNode</span>
<span class="c"> * @param treeId {String} the id of the tree instance</span>
<span class="c"> * @param nodeIndex {String} the index of the node to return</span>
<span class="c"> * @return {Node} the node instance requested, null if not found</span>
<span class="c"> * @static</span>
<span class="c"> */</span>
<span class="nx">TV</span><span class="o">.</span><span class="nx">getNode</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">treeId</span><span class="o">,</span> <span class="nx">nodeIndex</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="nx">TV</span><span class="o">.</span><span class="nx">getTree</span><span class="o">(</span><span class="nx">treeId</span><span class="o">);</span>
    <span class="k">return</span> <span class="o">(</span><span class="nx">t</span><span class="o">)</span> <span class="o">?</span> <span class="nx">t</span><span class="o">.</span><span class="nx">getNodeByIndex</span><span class="o">(</span><span class="nx">nodeIndex</span><span class="o">)</span> <span class="o">:</span> <span class="kc">null</span><span class="o">;</span>
<span class="o">};</span>


<span class="c">/**</span>
<span class="c">     * Class name assigned to elements that have the focus</span>
<span class="c">     *</span>
<span class="c">     * @property TreeView.FOCUS_CLASS_NAME</span>
<span class="c">     * @type String</span>
<span class="c">     * @static</span>
<span class="c">     * @final</span>
<span class="c">     * @default &quot;ygtvfocus&quot;</span>
<span class="c"></span>
<span class="c">    */</span> 
<span class="nx">TV</span><span class="o">.</span><span class="nx">FOCUS_CLASS_NAME</span> <span class="o">=</span> <span class="s1">&#39;ygtvfocus&#39;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c"> * Attempts to preload the images defined in the styles used to draw the tree by</span>
<span class="c"> * rendering off-screen elements that use the styles.</span>
<span class="c"> * @method YAHOO.widget.TreeView.preload</span>
<span class="c"> * @param {string} prefix the prefix to use to generate the names of the</span>
<span class="c"> * images to preload, default is ygtv</span>
<span class="c"> * @static</span>
<span class="c"> */</span>
<span class="nx">TV</span><span class="o">.</span><span class="nx">preload</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">,</span> <span class="nx">prefix</span><span class="o">)</span> <span class="o">{</span>
    <span class="nx">prefix</span> <span class="o">=</span> <span class="nx">prefix</span> <span class="o">||</span> <span class="s2">&quot;ygtv&quot;</span><span class="o">;</span>

    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Preloading images: &quot;</span> <span class="o">+</span> <span class="nx">prefix</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">,</span> <span class="s2">&quot;TreeView&quot;</span><span class="o">);</span>

    <span class="k">var</span> <span class="nx">styles</span> <span class="o">=</span> <span class="o">[</span><span class="s2">&quot;tn&quot;</span><span class="o">,</span><span class="s2">&quot;tm&quot;</span><span class="o">,</span><span class="s2">&quot;tmh&quot;</span><span class="o">,</span><span class="s2">&quot;tp&quot;</span><span class="o">,</span><span class="s2">&quot;tph&quot;</span><span class="o">,</span><span class="s2">&quot;ln&quot;</span><span class="o">,</span><span class="s2">&quot;lm&quot;</span><span class="o">,</span><span class="s2">&quot;lmh&quot;</span><span class="o">,</span><span class="s2">&quot;lp&quot;</span><span class="o">,</span><span class="s2">&quot;lph&quot;</span><span class="o">,</span><span class="s2">&quot;loading&quot;</span><span class="o">];</span>
    <span class="c">// var styles = [&quot;tp&quot;];</span>
<span class="c"></span>
    <span class="k">var</span> <span class="nx">sb</span> <span class="o">=</span> <span class="o">[];</span>
    
    <span class="c">// save the first one for the outer container</span>
<span class="c"></span>    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">1</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">styles</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> 
        <span class="nx">sb</span><span class="o">[</span><span class="nx">sb</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;&#39;</span> <span class="o">+</span> <span class="nx">prefix</span> <span class="o">+</span> <span class="nx">styles</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&amp;#160;&lt;/span&gt;&#39;</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="k">var</span> <span class="nx">f</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;div&quot;</span><span class="o">);</span>
    <span class="k">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">f</span><span class="o">.</span><span class="nx">style</span><span class="o">;</span>
    <span class="nx">s</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">prefix</span> <span class="o">+</span> <span class="nx">styles</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
    <span class="nx">s</span><span class="o">.</span><span class="nx">position</span> <span class="o">=</span> <span class="s2">&quot;absolute&quot;</span><span class="o">;</span>
    <span class="nx">s</span><span class="o">.</span><span class="nx">height</span> <span class="o">=</span> <span class="s2">&quot;1px&quot;</span><span class="o">;</span>
    <span class="nx">s</span><span class="o">.</span><span class="nx">width</span> <span class="o">=</span> <span class="s2">&quot;1px&quot;</span><span class="o">;</span>
    <span class="nx">s</span><span class="o">.</span><span class="nx">top</span> <span class="o">=</span> <span class="s2">&quot;-1000px&quot;</span><span class="o">;</span>
    <span class="nx">s</span><span class="o">.</span><span class="nx">left</span> <span class="o">=</span> <span class="s2">&quot;-1000px&quot;</span><span class="o">;</span>
    <span class="nx">f</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">sb</span><span class="o">.</span><span class="nx">join</span><span class="o">(</span><span class="s2">&quot;&quot;</span><span class="o">);</span>

    <span class="nb">document</span><span class="o">.</span><span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">f</span><span class="o">);</span>

    <span class="nx">Event</span><span class="o">.</span><span class="nx">removeListener</span><span class="o">(</span><span class="nb">window</span><span class="o">,</span> <span class="s2">&quot;load&quot;</span><span class="o">,</span> <span class="nx">TV</span><span class="o">.</span><span class="nx">preload</span><span class="o">);</span>

<span class="o">};</span>

<span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="nb">window</span><span class="o">,</span><span class="s2">&quot;load&quot;</span><span class="o">,</span> <span class="nx">TV</span><span class="o">.</span><span class="nx">preload</span><span class="o">);</span>
<span class="o">})();</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class="selected"><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.DateNode.html" title="YAHOO.widget.DateNode">YAHOO.widget.DateNode</a></li>
                                <li class=""><a href="YAHOO.widget.HTMLNode.html" title="YAHOO.widget.HTMLNode">YAHOO.widget.HTMLNode</a></li>
                                <li class=""><a href="YAHOO.widget.MenuNode.html" title="YAHOO.widget.MenuNode">YAHOO.widget.MenuNode</a></li>
                                <li class=""><a href="YAHOO.widget.Node.html" title="YAHOO.widget.Node">YAHOO.widget.Node</a></li>
                                <li class=""><a href="YAHOO.widget.RootNode.html" title="YAHOO.widget.RootNode">YAHOO.widget.RootNode</a></li>
                                <li class=""><a href="YAHOO.widget.TextNode.html" title="YAHOO.widget.TextNode">YAHOO.widget.TextNode</a></li>
                                <li class=""><a href="YAHOO.widget.TreeView.html" title="YAHOO.widget.TreeView">YAHOO.widget.TreeView</a></li>
                                <li class=""><a href="YAHOO.widget.TVAnim.html" title="YAHOO.widget.TVAnim">YAHOO.widget.TVAnim</a></li>
                                <li class=""><a href="YAHOO.widget.TVFadeIn.html" title="YAHOO.widget.TVFadeIn">YAHOO.widget.TVFadeIn</a></li>
                                <li class=""><a href="YAHOO.widget.TVFadeOut.html" title="YAHOO.widget.TVFadeOut">YAHOO.widget.TVFadeOut</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="DateNode.js.html" title="DateNode.js">DateNode.js</a></li>
                                <li class=""><a href="HTMLNode.js.html" title="HTMLNode.js">HTMLNode.js</a></li>
                                <li class=""><a href="MenuNode.js.html" title="MenuNode.js">MenuNode.js</a></li>
                                <li class=""><a href="Node.js.html" title="Node.js">Node.js</a></li>
                                <li class=""><a href="RootNode.js.html" title="RootNode.js">RootNode.js</a></li>
                                <li class=""><a href="TextNode.js.html" title="TextNode.js">TextNode.js</a></li>
                                <li class="selected"><a href="TreeView.js.html" title="TreeView.js">TreeView.js</a></li>
                                <li class=""><a href="TreeViewEd.js.html" title="TreeViewEd.js">TreeViewEd.js</a></li>
                                <li class=""><a href="TVAnim.js.html" title="TVAnim.js">TVAnim.js</a></li>
                                <li class=""><a href="TVFadeIn.js.html" title="TVFadeIn.js">TVFadeIn.js</a></li>
                                <li class=""><a href="TVFadeOut.js.html" title="TVFadeOut.js">TVFadeOut.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2009 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">
    ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.widget.TVFadeOut", "name": "animate", "url": "YAHOO.widget.TVFadeOut.html#method_animate", "type": "method"}, {"access": "", "host": "YAHOO.widget.TVFadeIn", "name": "animate", "url": "YAHOO.widget.TVFadeIn.html#method_animate", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "animateCollapse", "url": "YAHOO.widget.TreeView.html#method_animateCollapse", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "animateExpand", "url": "YAHOO.widget.TreeView.html#method_animateExpand", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "animComplete", "url": "YAHOO.widget.TreeView.html#event_animComplete", "type": "event"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_animCount", "url": "YAHOO.widget.TreeView.html#property__animCount", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "animStart", "url": "YAHOO.widget.TreeView.html#event_animStart", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "appendChild", "url": "YAHOO.widget.Node.html#method_appendChild", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "appendTo", "url": "YAHOO.widget.Node.html#method_appendTo", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "applyParent", "url": "YAHOO.widget.Node.html#method_applyParent", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "buildTreeFromMarkup", "url": "YAHOO.widget.TreeView.html#method_buildTreeFromMarkup", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "buildTreeFromObject", "url": "YAHOO.widget.TreeView.html#method_buildTreeFromObject", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateNode", "name": "calendarConfig", "url": "YAHOO.widget.DateNode.html#property_calendarConfig", "type": "property"}, {"access": "", "host": "YAHOO.widget.TVFadeOut", "name": "callback", "url": "YAHOO.widget.TVFadeOut.html#property_callback", "type": "property"}, {"access": "", "host": "YAHOO.widget.TVFadeIn", "name": "callback", "url": "YAHOO.widget.TVFadeIn.html#property_callback", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_canHaveFocus", "url": "YAHOO.widget.Node.html#method__canHaveFocus", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "children", "url": "YAHOO.widget.Node.html#property_children", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_childrenHighlighted", "url": "YAHOO.widget.Node.html#method__childrenHighlighted", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "childrenRendered", "url": "YAHOO.widget.Node.html#property_childrenRendered", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "className", "url": "YAHOO.widget.Node.html#property_className", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "clickEvent", "url": "YAHOO.widget.TreeView.html#event_clickEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_closeEditor", "url": "YAHOO.widget.TreeView.html#method__closeEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "collapse", "url": "YAHOO.widget.Node.html#method_collapse", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "collapse", "url": "YAHOO.widget.TreeView.html#event_collapse", "type": "event"}, {"access": "", "host": "YAHOO.widget.Node", "name": "collapseAll", "url": "YAHOO.widget.Node.html#method_collapseAll", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "collapseAll", "url": "YAHOO.widget.TreeView.html#method_collapseAll", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_collapseAnim", "url": "YAHOO.widget.TreeView.html#property__collapseAnim", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "collapseComplete", "url": "YAHOO.widget.TreeView.html#method_collapseComplete", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "collapseComplete", "url": "YAHOO.widget.TreeView.html#event_collapseComplete", "type": "event"}, {"access": "", "host": "YAHOO.widget.Node", "name": "completeRender", "url": "YAHOO.widget.Node.html#method_completeRender", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "contentElId", "url": "YAHOO.widget.Node.html#property_contentElId", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "contentStyle", "url": "YAHOO.widget.Node.html#property_contentStyle", "type": "property"}, {"access": "", "host": "YAHOO.widget.HTMLNode", "name": "contentStyle", "url": "YAHOO.widget.HTMLNode.html#property_contentStyle", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "currentFocus", "url": "YAHOO.widget.TreeView.html#property_currentFocus", "type": "property"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_currentlyHighlighted", "url": "YAHOO.widget.TreeView.html#property__currentlyHighlighted", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "data", "url": "YAHOO.widget.Node.html#property_data", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "dataLoader", "url": "YAHOO.widget.Node.html#property_dataLoader", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "dblClickEvent", "url": "YAHOO.widget.TreeView.html#event_dblClickEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_dblClickTimer", "url": "YAHOO.widget.TreeView.html#property__dblClickTimer", "type": "property"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_deleteNode", "url": "YAHOO.widget.TreeView.html#method__deleteNode", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "depth", "url": "YAHOO.widget.Node.html#property_depth", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "destroy", "url": "YAHOO.widget.TreeView.html#method_destroy", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_destroyEditor", "url": "YAHOO.widget.TreeView.html#method__destroyEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "destroyEditorContents", "url": "YAHOO.widget.Node.html#method_destroyEditorContents", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "destroyEditorContents", "url": "YAHOO.widget.TextNode.html#method_destroyEditorContents", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "draw", "url": "YAHOO.widget.TreeView.html#method_draw", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "dynamicLoadComplete", "url": "YAHOO.widget.Node.html#property_dynamicLoadComplete", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_dynLoad", "url": "YAHOO.widget.Node.html#property__dynLoad", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "editable", "url": "YAHOO.widget.Node.html#property_editable", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "editNode", "url": "YAHOO.widget.Node.html#method_editNode", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "editorData", "url": "YAHOO.widget.TreeView.html#property_editorData", "type": "property"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_el", "url": "YAHOO.widget.TreeView.html#property__el", "type": "property"}, {"access": "", "host": "YAHOO.widget.TVFadeOut", "name": "el", "url": "YAHOO.widget.TVFadeOut.html#property_el", "type": "property"}, {"access": "", "host": "YAHOO.widget.TVFadeIn", "name": "el", "url": "YAHOO.widget.TVFadeIn.html#property_el", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "enableHighlight", "url": "YAHOO.widget.Node.html#property_enableHighlight", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "enterKeyPressed", "url": "YAHOO.widget.TreeView.html#event_enterKeyPressed", "type": "event"}, {"access": "", "host": "YAHOO.widget.Node", "name": "expand", "url": "YAHOO.widget.Node.html#method_expand", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "expand", "url": "YAHOO.widget.TreeView.html#event_expand", "type": "event"}, {"access": "", "host": "YAHOO.widget.Node", "name": "expandAll", "url": "YAHOO.widget.Node.html#method_expandAll", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "expandAll", "url": "YAHOO.widget.TreeView.html#method_expandAll", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_expandAnim", "url": "YAHOO.widget.TreeView.html#property__expandAnim", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "expandComplete", "url": "YAHOO.widget.TreeView.html#method_expandComplete", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "expandComplete", "url": "YAHOO.widget.TreeView.html#event_expandComplete", "type": "event"}, {"access": "", "host": "YAHOO.widget.Node", "name": "expanded", "url": "YAHOO.widget.Node.html#property_expanded", "type": "property"}, {"access": "", "host": "YAHOO.widget.TVAnim", "name": "FADE_IN", "url": "YAHOO.widget.TVAnim.html#property_FADE_IN", "type": "property"}, {"access": "", "host": "YAHOO.widget.TVAnim", "name": "FADE_OUT", "url": "YAHOO.widget.TVAnim.html#property_FADE_OUT", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "fillEditorContainer", "url": "YAHOO.widget.Node.html#method_fillEditorContainer", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateNode", "name": "fillEditorContainer", "url": "YAHOO.widget.DateNode.html#method_fillEditorContainer", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "fillEditorContainer", "url": "YAHOO.widget.TextNode.html#method_fillEditorContainer", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "focus", "url": "YAHOO.widget.Node.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "focusChanged", "url": "YAHOO.widget.TreeView.html#event_focusChanged", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_focusedItem", "url": "YAHOO.widget.Node.html#property__focusedItem", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_focusHighlightedItems", "url": "YAHOO.widget.Node.html#property__focusHighlightedItems", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getAncestor", "url": "YAHOO.widget.Node.html#method_getAncestor", "type": "method"}, {"access": "", "host": "YAHOO.widget.TVAnim", "name": "getAnim", "url": "YAHOO.widget.TVAnim.html#method_getAnim", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getChildrenEl", "url": "YAHOO.widget.Node.html#method_getChildrenEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getChildrenElId", "url": "YAHOO.widget.Node.html#method_getChildrenElId", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "getChildrenHtml", "url": "YAHOO.widget.Node.html#method_getChildrenHtml", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getContentEl", "url": "YAHOO.widget.Node.html#method_getContentEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getContentHtml", "url": "YAHOO.widget.Node.html#method_getContentHtml", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getDepthStyle", "url": "YAHOO.widget.Node.html#method_getDepthStyle", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getEl", "url": "YAHOO.widget.Node.html#method_getEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getEl", "url": "YAHOO.widget.TreeView.html#method_getEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getElId", "url": "YAHOO.widget.Node.html#method_getElId", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_getEventTargetTdEl", "url": "YAHOO.widget.TreeView.html#method__getEventTargetTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getHoverStyle", "url": "YAHOO.widget.Node.html#method_getHoverStyle", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getHtml", "url": "YAHOO.widget.Node.html#method_getHtml", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getIconMode", "url": "YAHOO.widget.Node.html#method_getIconMode", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "getLabelEl", "url": "YAHOO.widget.TextNode.html#method_getLabelEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getNodeByElement", "url": "YAHOO.widget.TreeView.html#method_getNodeByElement", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getNodeByIndex", "url": "YAHOO.widget.TreeView.html#method_getNodeByIndex", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getNodeByProperty", "url": "YAHOO.widget.TreeView.html#method_getNodeByProperty", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getNodeCount", "url": "YAHOO.widget.Node.html#method_getNodeCount", "type": "method"}, {"access": "", "host": "YAHOO.widget.RootNode", "name": "getNodeCount", "url": "YAHOO.widget.RootNode.html#method_getNodeCount", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getNodeCount", "url": "YAHOO.widget.TreeView.html#method_getNodeCount", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getNodeDefinition", "url": "YAHOO.widget.Node.html#method_getNodeDefinition", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateNode", "name": "getNodeDefinition", "url": "YAHOO.widget.DateNode.html#method_getNodeDefinition", "type": "method"}, {"access": "", "host": "YAHOO.widget.RootNode", "name": "getNodeDefinition", "url": "YAHOO.widget.RootNode.html#method_getNodeDefinition", "type": "method"}, {"access": "", "host": "YAHOO.widget.HTMLNode", "name": "getNodeDefinition", "url": "YAHOO.widget.HTMLNode.html#method_getNodeDefinition", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "getNodeDefinition", "url": "YAHOO.widget.TextNode.html#method_getNodeDefinition", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getNodeHtml", "url": "YAHOO.widget.Node.html#method_getNodeHtml", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getNodesByProperty", "url": "YAHOO.widget.TreeView.html#method_getNodesByProperty", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getRoot", "url": "YAHOO.widget.TreeView.html#method_getRoot", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getSiblings", "url": "YAHOO.widget.Node.html#method_getSiblings", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getStyle", "url": "YAHOO.widget.Node.html#method_getStyle", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getToggleEl", "url": "YAHOO.widget.Node.html#method_getToggleEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getToggleElId", "url": "YAHOO.widget.Node.html#method_getToggleElId", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "getToggleLink", "url": "YAHOO.widget.Node.html#method_getToggleLink", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "getTreeDefinition", "url": "YAHOO.widget.TreeView.html#method_getTreeDefinition", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "hasChildren", "url": "YAHOO.widget.Node.html#method_hasChildren", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_hasDblClickSubscriber", "url": "YAHOO.widget.TreeView.html#property__hasDblClickSubscriber", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "hasIcon", "url": "YAHOO.widget.Node.html#property_hasIcon", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "hideChildren", "url": "YAHOO.widget.Node.html#method_hideChildren", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "highlight", "url": "YAHOO.widget.Node.html#method_highlight", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "highlightEvent", "url": "YAHOO.widget.TreeView.html#event_highlightEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.Node", "name": "highlightState", "url": "YAHOO.widget.Node.html#property_highlightState", "type": "property"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "href", "url": "YAHOO.widget.TextNode.html#property_href", "type": "property"}, {"access": "", "host": "YAHOO.widget.HTMLNode", "name": "html", "url": "YAHOO.widget.HTMLNode.html#property_html", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "iconMode", "url": "YAHOO.widget.Node.html#property_iconMode", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "id", "url": "YAHOO.widget.TreeView.html#property_id", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "index", "url": "YAHOO.widget.Node.html#property_index", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "init", "url": "YAHOO.widget.Node.html#method_init", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "init", "url": "YAHOO.widget.TreeView.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.HTMLNode", "name": "initContent", "url": "YAHOO.widget.HTMLNode.html#property_initContent", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "insertAfter", "url": "YAHOO.widget.Node.html#method_insertAfter", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "insertBefore", "url": "YAHOO.widget.Node.html#method_insertBefore", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "isChildOf", "url": "YAHOO.widget.Node.html#method_isChildOf", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "isDynamic", "url": "YAHOO.widget.Node.html#method_isDynamic", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "isLeaf", "url": "YAHOO.widget.Node.html#property_isLeaf", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "isLoading", "url": "YAHOO.widget.Node.html#property_isLoading", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "isRoot", "url": "YAHOO.widget.Node.html#method_isRoot", "type": "method"}, {"access": "", "host": "YAHOO.widget.TVAnim", "name": "isValid", "url": "YAHOO.widget.TVAnim.html#method_isValid", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "label", "url": "YAHOO.widget.TextNode.html#property_label", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "labelClick", "url": "YAHOO.widget.TreeView.html#event_labelClick", "type": "event"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "labelElId", "url": "YAHOO.widget.TextNode.html#property_labelElId", "type": "property"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "labelStyle", "url": "YAHOO.widget.TextNode.html#property_labelStyle", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "loadComplete", "url": "YAHOO.widget.Node.html#method_loadComplete", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "locked", "url": "YAHOO.widget.TreeView.html#property_locked", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "maxAnim", "url": "YAHOO.widget.TreeView.html#property_maxAnim", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "multiExpand", "url": "YAHOO.widget.Node.html#property_multiExpand", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "nextSibling", "url": "YAHOO.widget.Node.html#property_nextSibling", "type": "property"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_nodeEditing", "url": "YAHOO.widget.TreeView.html#method__nodeEditing", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_nodes", "url": "YAHOO.widget.TreeView.html#property__nodes", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "nowrap", "url": "YAHOO.widget.Node.html#property_nowrap", "type": "property"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_onClickEvent", "url": "YAHOO.widget.TreeView.html#method__onClickEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "onCollapse", "url": "YAHOO.widget.TreeView.html#method_onCollapse", "type": "method"}, {"access": "", "host": "YAHOO.widget.TVFadeOut", "name": "onComplete", "url": "YAHOO.widget.TVFadeOut.html#method_onComplete", "type": "method"}, {"access": "", "host": "YAHOO.widget.TVFadeIn", "name": "onComplete", "url": "YAHOO.widget.TVFadeIn.html#method_onComplete", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_onDblClickEvent", "url": "YAHOO.widget.TreeView.html#method__onDblClickEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "onEventEditNode", "url": "YAHOO.widget.TreeView.html#method_onEventEditNode", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "onEventToggleHighlight", "url": "YAHOO.widget.TreeView.html#method_onEventToggleHighlight", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "onExpand", "url": "YAHOO.widget.TreeView.html#method_onExpand", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_onKeyDownEvent", "url": "YAHOO.widget.TreeView.html#method__onKeyDownEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_onMouseOutEvent", "url": "YAHOO.widget.TreeView.html#method__onMouseOutEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_onMouseOverEvent", "url": "YAHOO.widget.TreeView.html#method__onMouseOverEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "parent", "url": "YAHOO.widget.Node.html#property_parent", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "parentChange", "url": "YAHOO.widget.Node.html#event_parentChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "popNode", "url": "YAHOO.widget.TreeView.html#method_popNode", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "previousSibling", "url": "YAHOO.widget.Node.html#property_previousSibling", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "propagateHighlightDown", "url": "YAHOO.widget.Node.html#property_propagateHighlightDown", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "propagateHighlightUp", "url": "YAHOO.widget.Node.html#property_propagateHighlightUp", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "refresh", "url": "YAHOO.widget.Node.html#method_refresh", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "regNode", "url": "YAHOO.widget.TreeView.html#method_regNode", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "removeChildren", "url": "YAHOO.widget.TreeView.html#method_removeChildren", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "_removeChildren_animComplete", "url": "YAHOO.widget.TreeView.html#method__removeChildren_animComplete", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_removeFocus", "url": "YAHOO.widget.Node.html#method__removeFocus", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "removeNode", "url": "YAHOO.widget.TreeView.html#method_removeNode", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "render", "url": "YAHOO.widget.TreeView.html#method_render", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "renderChildren", "url": "YAHOO.widget.Node.html#method_renderChildren", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "renderHidden", "url": "YAHOO.widget.Node.html#property_renderHidden", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "saveEditorValue", "url": "YAHOO.widget.Node.html#method_saveEditorValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateNode", "name": "saveEditorValue", "url": "YAHOO.widget.DateNode.html#method_saveEditorValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "saveEditorValue", "url": "YAHOO.widget.TextNode.html#method_saveEditorValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "setCollapseAnim", "url": "YAHOO.widget.TreeView.html#method_setCollapseAnim", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "setDynamicLoad", "url": "YAHOO.widget.Node.html#method_setDynamicLoad", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "setDynamicLoad", "url": "YAHOO.widget.TreeView.html#method_setDynamicLoad", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "setExpandAnim", "url": "YAHOO.widget.TreeView.html#method_setExpandAnim", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_setHighlightClassName", "url": "YAHOO.widget.Node.html#method__setHighlightClassName", "type": "method"}, {"access": "", "host": "YAHOO.widget.HTMLNode", "name": "setHtml", "url": "YAHOO.widget.HTMLNode.html#property_setHtml", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "setNodesProperty", "url": "YAHOO.widget.Node.html#method_setNodesProperty", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "setNodesProperty", "url": "YAHOO.widget.TreeView.html#method_setNodesProperty", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "setUpLabel", "url": "YAHOO.widget.TextNode.html#method_setUpLabel", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "showChildren", "url": "YAHOO.widget.Node.html#method_showChildren", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "singleNodeHighlight", "url": "YAHOO.widget.TreeView.html#property_singleNodeHighlight", "type": "property"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "target", "url": "YAHOO.widget.TextNode.html#property_target", "type": "property"}, {"access": "", "host": "YAHOO.widget.TextNode", "name": "title", "url": "YAHOO.widget.TextNode.html#property_title", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "toggle", "url": "YAHOO.widget.Node.html#method_toggle", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "toggleHighlight", "url": "YAHOO.widget.Node.html#method_toggleHighlight", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "toString", "url": "YAHOO.widget.Node.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "toString", "url": "YAHOO.widget.TreeView.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.TVFadeOut", "name": "toString", "url": "YAHOO.widget.TVFadeOut.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.TVFadeIn", "name": "toString", "url": "YAHOO.widget.TVFadeIn.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.Node", "name": "tree", "url": "YAHOO.widget.Node.html#property_tree", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "TreeView.FOCUS_CLASS_NAME", "url": "YAHOO.widget.TreeView.html#property_TreeView.FOCUS_CLASS_NAME", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Node", "name": "_type", "url": "YAHOO.widget.Node.html#property__type", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DateNode", "name": "_type", "url": "YAHOO.widget.DateNode.html#property__type", "type": "property"}, {"access": "private", "host": "YAHOO.widget.RootNode", "name": "_type", "url": "YAHOO.widget.RootNode.html#property__type", "type": "property"}, {"access": "private", "host": "YAHOO.widget.MenuNode", "name": "_type", "url": "YAHOO.widget.MenuNode.html#property__type", "type": "property"}, {"access": "private", "host": "YAHOO.widget.HTMLNode", "name": "_type", "url": "YAHOO.widget.HTMLNode.html#property__type", "type": "property"}, {"access": "private", "host": "YAHOO.widget.TextNode", "name": "_type", "url": "YAHOO.widget.TextNode.html#property__type", "type": "property"}, {"access": "", "host": "YAHOO.widget.Node", "name": "unhighlight", "url": "YAHOO.widget.Node.html#method_unhighlight", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "validator", "url": "YAHOO.widget.TreeView.html#property_validator", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "YAHOO.widget.TreeView.getNode", "url": "YAHOO.widget.TreeView.html#method_YAHOO.widget.TreeView.getNode", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "YAHOO.widget.TreeView.getTree", "url": "YAHOO.widget.TreeView.html#method_YAHOO.widget.TreeView.getTree", "type": "method"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "YAHOO.widget.TreeView.nodeCount", "url": "YAHOO.widget.TreeView.html#property_YAHOO.widget.TreeView.nodeCount", "type": "property"}, {"access": "", "host": "YAHOO.widget.TreeView", "name": "YAHOO.widget.TreeView.preload", "url": "YAHOO.widget.TreeView.html#method_YAHOO.widget.TreeView.preload", "type": "method"}, {"access": "private", "host": "YAHOO.widget.TreeView", "name": "YAHOO.widget.TreeView.trees", "url": "YAHOO.widget.TreeView.html#property_YAHOO.widget.TreeView.trees", "type": "property"}];
</script>
</body>
</html>
